<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>搜索页面</title>

		<link href="AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />
		<link href="AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css" />

		<link href="basic/css/demo.css" rel="stylesheet" type="text/css" />

		<link href="css/seastyle.css" rel="stylesheet" type="text/css" />

		<script type="text/javascript" src="basic/js/jquery-1.7.min.js"></script>
		<script type="text/javascript" src="js/script.js"></script>
	</head>

	<body>
		<jsp:include page="header.jsp"></jsp:include>
			<b class="line"></b>
           <div class="search">
			<div class="search-list">
			<div class="nav-table">
					   <div class="long-title"><span class="all-goods">全部分类</span></div>
					   <div class="nav-cont">
							<ul>
								<li class="index"><a href="#">首页</a></li>
                                <li class="qc"><a href="#">闪购</a></li>
                                <li class="qc"><a href="#">限时抢</a></li>
                                <li class="qc"><a href="#">团购</a></li>
                                <li class="qc last"><a href="#">大包装</a></li>
							</ul>
						    <div class="nav-extra">
						    	<i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的福利
						    	<i class="am-icon-angle-right" style="padding-left: 10px;"></i>
						    </div>
						</div>
			</div>
			
				
					<div class="am-g am-g-fixed">
						<div class="am-u-sm-12 am-u-md-12">
	                  	<div class="theme-popover">														
							<%--<div class="searchAbout">
								<span class="font-pale">相关搜索：</span>
								<a title="坚果" href="#">坚果</a>
								<a title="瓜子" href="#">瓜子</a>
								<a title="鸡腿" href="#">豆干</a>

							</div>--%>
							<ul class="select">
								<p class="title font-normal">
									<span class="fl">${key}</span>
									<span class="total fl">
										搜索到<strong class="num" style="color: red">${searchGoods.count}</strong>件相关商品</span>
										商品分<strong style="color: red;" class="totalPage">${searchGoods.totalPage}</strong>页显示
									每页<strong style="color: red;" class="totalPage">${searchGoods.pageCount}</strong>条数据
									现在是第<strong style="color: red;" class="totalPage">${searchGoods.pageIndex}</strong>页
<%--									搜索到<strong style="color: red;" class="count">${goodsPageBean.totalRecords}</strong>件相关商品--%>
<%--									商品分<strong style="color: red;" class="totalPage">${goodsPageBean.totalPage}</strong>页显示--%>
<%--									每页<strong style="color: red;" class="totalPage">${goodsPageBean.pageSize}</strong>条数据--%>
<%--									现在是第<strong style="color: red;" class="totalPage">${goodsPageBean.pageNo}</strong>页--%>
								</p>
								<div class="clear"></div>
								<li class="select-result">
									<dl>
										<dt>已选</dt>
										<dd class="select-no"></dd>
										<p class="eliminateCriteria">清除</p>
									</dl>
								</li>
								<div class="clear"></div>
								<%--<li class="select-list">
									<dl id="select1">
										<dt class="am-badge am-round">品牌</dt>	
									
										 <div class="dd-conent">										
											<dd class="select-all selected"><a href="#">全部</a></dd>
											<dd><a href="#">百草味</a></dd>
											<dd><a href="#">良品铺子</a></dd>
											<dd><a href="#">新农哥</a></dd>
											<dd><a href="#">楼兰蜜语</a></dd>
											<dd><a href="#">口水娃</a></dd>
											<dd><a href="#">考拉兄弟</a></dd>
										 </div>
						
									</dl>
								</li>--%>
								<%--<li class="select-list">
									<dl id="select2">
										<dt class="am-badge am-round">种类</dt>
										<div class="dd-conent">
											<dd class="select-all selected"><a href="#">全部</a></dd>
											<dd><a href="#">东北松子</a></dd>
											<dd><a href="#">巴西松子</a></dd>
											<dd><a href="#">夏威夷果</a></dd>
											<dd><a href="#">松子</a></dd>
										</div>
									</dl>
								</li>--%>
								<%--<li class="select-list">
									<dl id="select3">
										<dt class="am-badge am-round">选购热点</dt>
										<div class="dd-conent">
											<dd class="select-all selected"><a href="#">全部</a></dd>
											<dd><a href="#">手剥松子</a></dd>
											<dd><a href="#">薄壳松子</a></dd>
											<dd><a href="#">进口零食</a></dd>
											<dd><a href="#">有机零食</a></dd>
										</div>
									</dl>
								</li>--%>
					        
							</ul>
							<div class="clear"></div>
                        </div>
							<div class="search-content">
								<div class="sort">
									<li class="first"><a id="count" title="销量">销量排序</a></li>
									<li><a id="price" title="价格">价格优先</a></li>
								</div>
								<div class="clear"></div>
								<script type="text/javascript">
									$("#count").click(function () {
										var key = $("#searchInput").val();
										var sort = "saleCount";
										$(this).attr("href","search?index_none_header_sysc="+key+"&orderBy="+sort);
									});
									$("#price").click(function () {
										var key = $("#searchInput").val();
										var sort = "shopPrice";
										$(this).attr("href","search?index_none_header_sysc="+key+"&orderBy="+sort);
									})
								</script>
								<c:if test="${searchGoods.data.size()!=0}">
									<ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 boxes">
										<c:forEach items="${searchGoods.data}" var="jg">
											<li>
												<div class="i-pic limit" onclick="goodsInfo(${jg.goodsId})" id="goodsInfo">
													<img src="${jg.goodsImg}" />
													<p class="title fl">${jg.goodsName}</p>
													<p class="price fl">
														<b>¥</b>
														<strong>${jg.shopPrice}</strong>
													</p>
													<p class="number fl">
														销量<span>${jg.saleCount}</span>
													</p>
													<p id="spid" style="display: none;">${jg.goodsId}</p>
												</div>
											</li>
										</c:forEach>
									</ul>
								</c:if>
								<c:if test="${searchGoods.data.size() == 0}">
									<div style="margin-left: 47%;margin-top: 10%">暂无该类型商品~</div>
								</c:if>
							</div>
							<div class="search-side">

								<div class="side-title">
									热销产品
								</div>

								<c:forEach items="${goodsByLike}" var="like">
									<li>
										<div class="i-pic check" onclick="goodsInfo(${like.goodsId})">
											<img src="${like.goodsImg}" />
											<p class="check-title" style="font-size: 14px">${like.goodsName.substring(0,10)}</p>
											<p class="price fl">
												<b>¥</b>
												<strong>${like.shopPrice}</strong>
											</p>
											<p class="number fl">
												销量<span>${like.saleCount}</span>
											</p>
										</div>
									</li>
								</c:forEach>
							</div>
							<div class="clear"></div>
							<!--分页 -->
							<ul class="am-pagination am-pagination-right">
								<c:if test="${searchGoods.pageIndex>searchGoods.headPage}">
									<li><a href="search?pageNo=${searchGoods.prevPage}&&index_none_header_sysc=${key}">&laquo;</a></li>
								</c:if>
								<c:if test="${searchGoods.pageIndex<=searchGoods.headPage}">
									<li><a href="javascript:void(0);alert('已经是首页');">&laquo;</a></li>
								</c:if>
								<li><a href="search?pageNo=${searchGoods.headPage}&&index_none_header_sysc=${key}">首页</a></li>
								<li><a href="search?pageNo=${searchGoods.footPage}&&index_none_header_sysc=${key}">尾页</a></li>
								<c:if test="${searchGoods.pageIndex<searchGoods.footPage}">
									<li><a href="search?pageNo=${searchGoods.nextPage}&&index_none_header_sysc=${key}">&raquo;</a></li>
								</c:if>
								<c:if test="${searchGoods.pageIndex >= searchGoods.footPage}">
									<li><a href="javascript:void(0);alert('已经是最后一页');">&raquo;</a></li>
								</c:if>
							</ul>

						</div>
					</div>
					<jsp:include page="foot.jsp"></jsp:include>
				</div>

			</div>

		<!--引导 -->
		<div class="navCir">
			<li><a href="home2.jsp"><i class="am-icon-home "></i>首页</a></li>
			<li><a href="sort.jsp"><i class="am-icon-list"></i>分类</a></li>
			<li><a href="shopcart.jsp"><i class="am-icon-shopping-basket"></i>购物车</a></li>
			<li><a href="person/index.jsp"><i class="am-icon-user"></i>我的</a></li>
		</div>

		<!--菜单 -->
		<jsp:include page="nav.jsp"></jsp:include>
		<script>
			window.jQuery || document.write('<script src="basic/js/jquery-1.9.min.js"><\/script>');
		</script>
		<script type="text/javascript" src="basic/js/quick_links.js"></script>
		<script type="text/javascript">
			function goodsInfo(id) {
				location.href="info?id="+id;
			}
		</script>

<div class="theme-popover-mask"></div>

	</body>

</html>